/*
 *  GWReverserEffect.h
 *  GWGlitch
 *
 *  Created by Michael Forrest on 01/03/2008.
 *  Copyright 2008 Grimaceworks. All rights reserved.
 *
 */

#import "GWEffectBase.h"
class GWReverserEffect : public GWEffectBase {
	public:
		GWReverserEffect(AUKernelBase * kernel) : GWEffectBase(kernel){
			Reset();
		}
		~GWReverserEffect(){
			delete loop;
		}
		virtual void 		Process(const Float32		*inSourceP,
								Float32		*inDestP,  
								UInt32 		inFramesToProcess,  
								UInt32		inNumChannels,  
								bool		&ioSilence);
		virtual void		Reset(){			
			loopPosition = 0;
			forwards = true;
		}
	private:
		UInt32 samplesPerBeat;
		enum{loopSize = 96000};
		UInt32 loopPosition;
		Float32   loop [loopSize];
		bool forwards; 
};